/**
 * class 处理
 */

const renderer = createRenderer({
    // 省略其他选项

    patchProps(el, key, prevValue, nextValue) {
        // 对 class 进行特殊处理
        if (key === 'class') {
            el.className = nextValue || ''
        } else if (shouldSetAsProps(el, key, nextValue)) {
            const type = typeof el[key]
            if (type === 'boolean' && nextValue === '') {
                el[key] = true
            } else {
                el[key] = nextValue
            }
        } else {
            el.setAttribute(key, nextValue)
        }
    }
})